package top.forforever.srb.oss.prop;

import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @create: 2023/5/4
 * @Description:
 * @FileName: OssProperties
 * @自定义内容：
 */
@Data
@Component
@ConfigurationProperties(prefix = "aliyun.oss")
public class OssProperties implements InitializingBean {

    public static String  END_POINT;
    public static String  KEY_ID;
    public static String  KEY_SECRET;
    public static String  BUCKET_NAME;

    private String endpoint;
    private String keyId;
    private String keySecret;
    private String bucketName;

    @Override
    public void afterPropertiesSet() throws Exception {
        END_POINT = endpoint;
        KEY_ID = keyId;
        KEY_SECRET = keySecret;
        BUCKET_NAME = bucketName;
    }
}
